function MarqueeNews() {
    $("#news").find("ul").animate({
        "marginTop": "-20px"
    }, 1e3, function() {
        $(this).css({
            "marginTop": "0px"
        }).find("li:first").appendTo(this);
    });
}

function gstop() {
    clearInterval(MarNews);
}

function gstart() {
    MarNews = setInterval(MarqueeNews, 3e3);
}

function goup() {
    $("#news").find("ul li").last().insertBefore($("#news").find("ul li").first()), $("#news").find("ul").css({
        "marginTop": "-20px"
    }), $("#news").find("ul").animate({
        "marginTop": "0px"
    }, 500);
}

function godown() {
    $("#news").find("ul").animate({
        "marginTop": "-20px"
    }, 500, function() {
        $(this).css({
            "marginTop": "0px"
        }).find("li:first").appendTo(this);
    });
}

function show_coupon_edit_btn() {
    $(".coupon_edit").each(function() {
        var a = $(this).attr("id"), b = a.split("-"), c = '<a title="编辑此券" href="' + admin_host + "/wp-admin/admin.php?page=add_coupon&coupon_id=" + b[1] + '&action=edit" >编辑此券</a>';
        $(this).html(c);
    });
}

function show_product_edit_btn() {
    $(".product_edit").each(function() {
        var a = $(this).attr("id"), b = a.split("-"), c = '<a title="编辑此礼品" href="' + domain_host + "/wp-admin/admin.php?page=products_add&pid=" + b[1] + '" class="couponEdit">编辑此礼品</a>';
        $(this).html(c);
    });
}

function show_post_edit_btn() {
    $(".post_edit").each(function() {
        var a = $(this).attr("id"), b = a.split("-"), c = '<a title="编辑文章" href="' + domain_host + "/wp-admin/post.php?post=" + b[1] + '&action=edit" class="post-edit-link">编辑文章</a>';
        $(this).html(c);
    });
}

function show_comment_edit_btn() {
    $(".edit-comment").each(function() {
        var a = $(this).attr("id"), b = a.split("-"), c = '[<a title="编辑评论" href="' + domain_host + "/wp-admin/comment.php?action=editcomment&c=" + b[1] + '" class="comment-edit-link">编辑评论</a>] [<a href="#" class="comment-edit-link" onclick="return comment_updatestatus(' + b[1] + ",1" + ')">垃圾评论</a>] [<a href="#" class="comment-edit-link" onclick="return comment_updatestatus(' + b[1] + ",2" + ')">删除</a>]';
        $(this).html(c);
    });
}

function comment_updatestatus(c, b) {
    var a = "";
    if (b == 1) a = "确定要放入垃圾评论？"; else {
        if (b != 2) return !1;
        a = "确定要删除该评论？";
    }
    return confirm(a) && $.ajax({
        "type": "GET",
        "url": domain_host + "/wp-content/plugins/clogin/update_postcomment_status.php",
        "data": "comment_id=" + c + "&type=" + b,
        "success": function(d) {
            d ? (alert("操作成功!"), $("#li-comment-" + c).css("display", "none")) : alert("操作失败!");
        }
    }), !1;
}

function show_excerpt_handle() {
    $("div.conBox").each(function() {
        $first_p = $(this).children(".p_excerpt"), getStrLength($first_p.text()) < 436 && ($next_html = $first_p.next(".p_detail").html(), $next_html != null && $next_html.indexOf("my_add_text") < 0 && $next_html.toLowerCase().indexOf("<img") < 0 && $next_html.toLowerCase().indexOf("<blockquote") < 0 && $first_p.append($("<p class='my_add_text' style='padding: 0px; margin: 20px 0px 0px; display: block;'></p>").html($next_html)));
    });
}

$(function() {
    $(".tjlb").find("li:last").addClass("alink"), $(".tstj").find("li:last").addClass("alink"), $(".htzx").find("li:last").addClass("alink"), $(".sjdq").find("li:last").addClass("alink"), $(".yhq").find("li:last").addClass("alink");
}), $(function() {
    var a = window.location.toString(), c = a.split("#")[1];
    if ($("#" + c).offset() != null) {
        var b = $("#" + c).offset().top;
        c == "commentnaviBottom" ? $(window).scrollTop(b - 300) : $("html,body").animate({
            "scrollTop": b - 50
        }, 100);
    }
});

var MarNews = setInterval(MarqueeNews, 3e3), is_am = 0, domain_host = "http://" + window.location.host, admin_host = "http://www.smzdm.com";
